﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:es="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing" 
    x:Class="OmnipotentFlashlight.Soft"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" xmlns:local="clr-namespace:OmnipotentFlashlight">
	
	<phone:PhoneApplicationPage.Resources>
        <local:Stri x:Key="Stri"/>
		<DataTemplate x:Key="DataTemplate1">
            <StackPanel Margin="5,10,5,5" Height="163" Width="470" Orientation="Horizontal">
            	<Image Source="{Binding imgUrl}" Stretch="UniformToFill" HorizontalAlignment="Left" Width="135" Margin="5,14,0,14" Height="135"/>
            	<Canvas Width="320" Margin="5,0,0,0">
            		<TextBlock  Width="304" Tag="{Binding appid}" Text="{Binding title}" 
					FontSize="42.667" Height="56" VerticalAlignment="Top" Canvas.Left="8" Canvas.Top="8"/>
            		<TextBlock Canvas.Left="8" TextWrapping="Wrap" Canvas.Top="104" 
					Width="140" Foreground="#4CFFFFFF" Height="38" FontSize="28">
            			<Run Text="下载"/><Run Text="{Binding downcount}"/><Run Text="次"/>		
					</TextBlock>
            		<Canvas Height="33" Canvas.Left="148" Canvas.Top="109" Width="172">
                        <es:RegularPolygon x:Name="s1" Fill="{Binding scores, Converter={StaticResource Stri}, ConverterParameter=1}" Height="33" InnerRadius="0.47211" PointCount="5" Stretch="Fill" UseLayoutRounding="False" Width="33"/>
                        <es:RegularPolygon x:Name="s2" Fill="{Binding scores, Converter={StaticResource Stri}, ConverterParameter=2}" Height="33" InnerRadius="0.47211" Canvas.Left="33" PointCount="5" Stretch="Fill" UseLayoutRounding="False" Width="33"/>
                        <es:RegularPolygon x:Name="s3" Fill="{Binding scores, Converter={StaticResource Stri}, ConverterParameter=3}" Height="33" InnerRadius="0.47211" Canvas.Left="66" PointCount="5" Stretch="Fill" UseLayoutRounding="False" Width="33"/>
                        <es:RegularPolygon x:Name="s4" Fill="{Binding scores, Converter={StaticResource Stri}, ConverterParameter=4}" Height="33" InnerRadius="0.47211" Canvas.Left="99" PointCount="5" Stretch="Fill" UseLayoutRounding="False" Width="33"/>
                        <es:RegularPolygon x:Name="s5" Fill="{Binding scores, Converter={StaticResource Stri}, ConverterParameter=5}" Height="33" InnerRadius="0.47211" Canvas.Left="132" PointCount="5" Stretch="Fill" UseLayoutRounding="False" Width="33"/>
            		</Canvas>
            	</Canvas>
            </StackPanel>
        </DataTemplate>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left"/>
        </ItemsPanelTemplate>
	</phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.Style>
		<StaticResource ResourceKey="TransitionPageStyle"/>
	</phone:PhoneApplicationPage.Style>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
       <!--透视控件-->
		<controls:Pivot x:Name="piv" Title="精品软件推荐" SelectionChanged="Pivot_SelectionChanged">
			<!--透视项目一-->
			<controls:PivotItem Header="最新" Margin="3,28,12,0">
				<Grid x:Name="ContentPanel">
                    <ListBox x:Name="list" ItemsSource="{Binding}" 
					toolkit:TiltEffect.IsTiltEnabled="True" ItemTemplate="{StaticResource DataTemplate1}" 
						ItemsPanel="{StaticResource ItemsPanelTemplate1}"/>
                </Grid>
			</controls:PivotItem>

 			<!--透视项目二-->
			<controls:PivotItem Header="最热" Margin="0,28,0,0">
				<Grid x:Name="ContentPanel2" Grid.Row="1" Margin="0">
                    <ListBox x:Name="list2" ItemsSource="{Binding}" 
					toolkit:TiltEffect.IsTiltEnabled="True" ItemTemplate="{StaticResource DataTemplate1}" 
						ItemsPanel="{StaticResource ItemsPanelTemplate1}" Visibility="Collapsed" />
                    <TextBlock x:Name="s_loading2" Margin="23,26,74,0" TextWrapping="Wrap" Text="加载中...." VerticalAlignment="Top" Height="51" FontSize="32"/>
                </Grid>
			</controls:PivotItem>
		</controls:Pivot>

        <!--ContentPanel - 在此处放置其他内容-->
        
    </Grid>
 
</phone:PhoneApplicationPage>
